package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 系统审核状态（1-管理后台待审核，2-管理后台审核失败，3-汇付基本信息入驻待审核，4-汇付基本信息入驻审核拒绝，5-汇付基本信息入驻审核成功，" +
 * "6-汇付商户业务开通待审核，7-汇付商户业务开通审核拒绝，8-汇付商户业务开通待开通，9-汇付商户业务开通成功，10-子账户待开通，11-子账户开通审核拒绝，12-子账户开通审核通过，
 * 13-微信实名待认证，14-微信实名认证失败，15-合同待签约，16-合同签约失败，17-签约认证成功）
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum SystemAuditStateEnum {

    MANAGER_WAIT_AUDIT(1, "管理后台待审核"),
    MANAGER_AUDIT_FAIL(2, "管理后台审核失败"),
    HF_ENTER_WAIT_AUDIT(3, "汇付基本信息入驻待审核"),
    HF_ENTER_AUDIT_FAIL(4, "汇付基本信息入驻审核拒绝"),
    HF_ENTER_AUDIT_SUCCESS(5, "汇付基本信息入驻审核成功"),
    HF_OPEN_WAIT_AUDIT(6, "汇付商户业务开通待审核"),
    HF_OPEN_AUDIT_FAIL(7, "汇付商户业务开通审核拒绝"),
    HF_OPEN_WAIT(8, "汇付商户业务开通待开通"),
    HF_OPEN_SUCCESS(9, "汇付商户业务开通成功"),
    SUB_ACCOUNT_WAIT_OPEN(10, "子账户待开通"),
    SUB_ACCOUNT_OPEN_AUDIT_FAIL(11, "子账户开通审核拒绝"),
    SUB_ACCOUNT_OPEN_AUDIT_SUCCESS(12, "子账户开通审核通过"),

    WX_REAL_WAIT_AUTH(13, "微信实名待认证"),
    WX_REAL_WAIT_AUTH_FAIL(14, "微信实名认证失败"),
    CONTRACT_WAIT_SIGN(15, "合同待签约"),
    CONTRACT_WAIT_SIGN_FAIL(16, "合同签约失败"),
    SIGN_SUCCESS(17, "签约认证成功"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    SystemAuditStateEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static SystemAuditStateEnum typeOf(Integer value) {
        SystemAuditStateEnum[] values = SystemAuditStateEnum.values();
        for (SystemAuditStateEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static SystemAuditStateEnum typeOf(String name) {
        SystemAuditStateEnum[] values = SystemAuditStateEnum.values();
        for (SystemAuditStateEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
